from flask_sqlalchemy import SQLAlchemy

db = SQLAlchemy()


class Photo_album(db.Model):
    __tablename__ = "photo_album"
    id = db.Column(db.Integer,autoincrement=True,primary_key=True,comment="ID")
    name = db.Column(db.String(32),comment="相册目录")



class Photo(db.Model):
    __tablename__= "photo"
    id = db.Column(db.Integer,autoincrement=True,primary_key=True,comment="ID")
    name = db.Column(db.String(32),comment="相册名称")
    url = db.Column(db.String(100),comment="图片")
    photo_album_id = db.Column(db.Integer,db.ForeignKey("photo_album.id"))

# db.create_all()